//
//  DelLoaclFile.swift
//  WriteToLocal
//
//  Created by 郑东喜 on 2017/2/24.
//  Copyright © 2017年 郑东喜. All rights reserved.
//  删除文件操作

import UIKit

class DelLoaclFile: UIViewController {

    /// 删除文件
    fileprivate lazy var delSuccess: UIAlertController = {
        let d : UIAlertController = UIAlertController.init(title: "提示", message: "删除文件成功！", preferredStyle: .alert)
        
        d.addAction(UIAlertAction.init(title: "好的", style: .default, handler: nil))
        return d
    }()
    
    /// 无文件
    fileprivate lazy var alVC: UIAlertController = {
        let d : UIAlertController = UIAlertController.init(title: "提示", message: "无缓存配置文件！", preferredStyle: .alert)
        
        d.addAction(UIAlertAction.init(title: "好的", style: .default, handler: nil))
        return d
    }()
    

    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        
        if FileExist.fileIsExist(filePathStr: "/Documents/bj") == true {

            
            
            FileExist.delFile(str: "/Documents/bj")
            
            
            self.present(delSuccess, animated: true, completion: nil)
            
        } else {
            self.present(alVC, animated: true, completion: nil)
        }
        
    }
    
    
}
